package com.liyiruo.beans;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * ServletContextAware
 * 为什么这个不能用呢？
 */
public class MyAware implements BeanNameAware, BeanFactoryAware, ApplicationContextAware {
    @Override
    public void setBeanName(String beanName) {
        System.out.println("beanName=>"+beanName);
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        System.out.println("beanFactory=>"+beanFactory);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("applicationContext=>"+applicationContext);
    }



}
